import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
const Home = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Home.vue')
// import Login from '../components/Login.vue'
const Login = () => import(/* webpackChunkName: "login_home_welcome" */ '../components/Login.vue')

// import Welcome from '../components/Welcome.vue'
const Welcome = () => import(/* webpackChunkName: "login_home_welcome" */ '../components/Welcome.vue')
// import Categories from '../views/Categories.vue'
const Categories = () => import(/* webpackChunkName: "Categories_Params" */ '../views/Categories.vue')
// import Goods from '../views/Goods.vue'
const Goods = () => import(/* webpackChunkName: "Goods_addGoods" */ '../views/Goods.vue')
// import Orders from '../views/Orders.vue'
const Orders = () => import(/* webpackChunkName: "Orders_Reports" */ '../views/Orders.vue')
// import Params from '../views/Params.vue'
const Params = () => import(/* webpackChunkName: "Categories_Params" */ '../views/Params.vue')
// import Reports from '../views/Reports.vue'
const Reports = () => import(/* webpackChunkName: "Orders_Reports" */ '../views/Reports.vue')
// import Rights from '../views/Rights.vue'
const Rights = () => import(/* webpackChunkName: "Users_Rights_Roles" */ '../views/Rights.vue')
// import Roles from '../views/Roles.vue'
const Roles = () => import(/* webpackChunkName: "Users_Rights_Roles" */ '../views/Roles.vue')
// import Users from '../views/Users.vue'
const Users = () => import(/* webpackChunkName: "Users_Rights_Roles" */ '../views/Users.vue')
// import addGoods from '../views/addGoods.vue'
const addGoods = () => import(/* webpackChunkName: "Goods_addGoods" */ '../views/addGoods.vue')
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect:'/welcome',
    children:[
      {
        path:'/welcome',
        component:Welcome
      },
      {
        path:'/categories',
        component:Categories
      },
      {
        path:'/goods',
        component:Goods
      },
      {
        path:'/orders',
        component:Orders
      },
      {
        path:'/params',
        component:Params
      },
      {
        path:'/reports',
        component:Reports
      },
      {
        path:'/rights',
        component:Rights
      },
      {
        path:'/roles',
        component:Roles
      },
      {
        path:'/users',
        component:Users
      },
      {
        path: '/goods/add',
        name: 'addGoods',
        component: addGoods
      },
    ]
  },
 

]

const router = new VueRouter({
  routes
})

export default router
